// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Core;
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations;

[JsonConverter(typeof(AggregateDictionaryConverter))]
public partial class AggregateDictionary : IsAReadOnlyDictionary<string, IAggregate>
{
	public AggregateDictionary(IReadOnlyDictionary<string, IAggregate> backingDictionary) : base(backingDictionary)
	{
	}

	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregate? GetCardinality(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentilesAggregate? GetTDigestPercentiles(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentilesAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentileRanksAggregate? GetTDigestPercentileRanks(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentileRanksAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregate? GetPercentilesBucket(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MedianAbsoluteDeviationAggregate? GetMedianAbsoluteDeviation(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.MedianAbsoluteDeviationAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinAggregate? GetMin(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregate? GetMax(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregate? GetSum(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregate? GetAverage(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregate? GetWeightedAverage(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregate? GetValueCount(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregate? GetDerivative(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsAggregate? GetStats(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsBucketAggregate? GetStatsBucket(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsBucketAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsAggregate? GetExtendedStats(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsBucketAggregate? GetExtendedStatsBucket(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsBucketAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoBoundsAggregate? GetGeoBounds(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoBoundsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoCentroidAggregate? GetGeoCentroid(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoCentroidAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregate? GetHistogram(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregate? GetDateHistogram(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregate? GetAutoDateHistogram(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregate? GetVariableWidthHistogram(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringTermsAggregate? GetStringTerms(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringTermsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.LongTermsAggregate? GetLongTerms(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.LongTermsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DoubleTermsAggregate? GetDoubleTerms(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.DoubleTermsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringRareTermsAggregate? GetStringRareTerms(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringRareTermsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregate? GetMultiTerms(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingAggregate? GetMissing(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregate? GetNested(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregate? GetReverseNested(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregate? GetGlobal(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FilterAggregate? GetFilter(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.FilterAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregate? GetChildren(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregate? GetParent(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregate? GetSampler(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregate? GetGeohashGrid(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregate? GetGeotileGrid(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregate? GetGeohexGrid(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregate? GetRange(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregate? GetDateRange(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoDistanceAggregate? GetGeoDistance(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoDistanceAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregate? GetIpRange(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregate? GetIpPrefix(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregate? GetFilters(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregate? GetAdjacencyMatrix(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantStringTermsAggregate? GetSignificantStringTerms(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantStringTermsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregate? GetComposite(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregate? GetScriptedMetric(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregate? GetTopHits(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregate? GetInference(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregate? GetStringStats(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregate? GetBoxplot(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsAggregate? GetTopMetrics(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestAggregate? GetTTest(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregate? GetRate(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregate? GetCumulativeCardinality(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregate? GetMatrixStats(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregate?>(key);
	public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregate? GetGeoLine(string key) => TryGet<Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregate?>(key);
	private TAggregate TryGet<TAggregate>(string key) where TAggregate : class, IAggregate => BackingDictionary.TryGetValue(key, out var agg) ? agg as TAggregate : null;
}